package com.zeropoint.demo.util;

public class ArrayUtils {

    public static String[] addAllStr(String[] a, String[] b){

        if(a == null && b != null) return b;
        if(a != null && b == null) return a;
        if(a == null && b == null) return new String[0];

        String[] allStr = new String[a.length+b.length];

        int j = 0;
        for(int i = 0; i < a.length; i++){
            allStr[j++] = a[i];
        }

        for(int i = 0; i < b.length; i++){
            allStr[j++] = b[i];
        }

        return allStr;
    }

    public static boolean isContains(String[] a, String x){
        if(a == null || x == null) return false;

        for (int i = 0; i < a.length; i++) {
            if(a[i].contains(x)){
                return true;
            }
        }
        return false;
    }

}
